package com.lcy.chat;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class ChatActivity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
        
        Button btn = (Button)findViewById(R.id.ststart);
        btn.setOnClickListener(this);
      
        
    }
    
	@Override
	public void onClick(View v) {
		
		// TODO Auto-generated method stub		
		
		EditText et = (EditText)findViewById(R.id.input_id);
		
		if(!et.getText().toString().equals("")){
			
			MessageBean.userId = et.getText().toString();			
			
			Intent it = new Intent(this, MainChat.class);
			startActivity(it);
			finish();
			
		}else{
			
			//���
	    	AlertDialog.Builder alert = new AlertDialog.Builder(ChatActivity.this);
	    	alert.setTitle("정보창");
	    	alert.setMessage("오류발생.");
	    	alert.setIcon(R.drawable.icon);
	    	alert.setPositiveButton("확인", null);
	    	alert.show();
		}			
	}
	
}